<!DOCTYPE html>
<!-- saved from url=(0064)https://guanchao.site/index/article/articledetail.html?artid=391 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>时间里的博客_技术博客</title>

<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="Cache-Control" content="no-siteapp">
<meta name="keywords" content="的博客,时间里的,时间里的博客,php博客系统,设计模式">
<meta name="description" content="时间里的博客系统，一个站在php开发之路上的草根程序员个人博客网站。">
<link rel="Bookmark" href="https://guanchao.site/uploads/website/5c093bf268185.png">
<!-- <LINK rel="Bookmark" href="favicon.ico" > -->
<link rel="Shortcut Icon" href="https://guanchao.site/uploads/website/5c093bf268185.png">
<!-- <LINK rel="Shortcut Icon" href="favicon.ico" /> -->

<link rel="stylesheet" type="text/css" href="/static/css/H-ui.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/iconfont.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/common.css">
<link rel="stylesheet" type="text/css" href="/static/css/page.css">
<link rel="stylesheet" type="text/css" href="/static/css/pifu.css">
<link rel="stylesheet" type="text/css" href="/static/css/timeline.css">
<link rel="stylesheet" type="text/css" href="/static/css/wangEditor.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/layui.css">

<link rel="stylesheet" type="text/css" href="/static/css/detail_enter-f696faad0a.min.css">

<link rel="stylesheet" type="text/css" href="/static/css/markdown_views-60ecaf1f42.css">
<link rel="stylesheet" type="text/css" href="/static/css/atom-one-light.css">

<!--style文件夹中，每一个css就是一个样式主题，可自行选择-->
<link rel="stylesheet" type="text/css" href="/static/css/github.css">

<!-- <script type="text/javascript" src="/style/home/plugin/jquery/1.9.1/jquery.min.js"></script> -->
<script type="text/javascript" src="/static/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/static/js/layer.js"></script><link rel="stylesheet" href="/static/css/layer.css" id="layuicss-layer">
<script type="text/javascript" src="/static/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/js/pifu.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/wangEditor.min.js"></script>

<script type="text/javascript" src="/static/js/shCore.js"></script>
<link rel="stylesheet" type="text/css" href="/static/css/shCoreDefault.css">

<script> $(function () { $(window).on("scroll", backToTopFun); backToTopFun(); }); </script>
<script type="text/javascript" src="/static/js/jquery.SuperSlide.min.js"></script>
<script type="application/x-javascript"> /*addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }//*/ function showSide(){$('.navbar-nav').toggle();}</script>

<script>
    window.onscroll = function() {
        // 获取滚动条位置
        var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        // 设置cookie
        SetCookie("a", scrollTop);

        // ===============  回到顶部部分代码 ==============
        var timer = null;//时间标识符
        var isTop = true;
        
        var obtn = document.getElementsByClassName('to_top')[0];
        obtn.onclick = function(){
            // 设置定时器
            timer = setInterval(function(){
                var osTop = document.documentElement.scrollTop || document.body.scrollTop;
                //减小的速度
                var isSpeed = Math.floor(-osTop/6);
                document.documentElement.scrollTop = document.body.scrollTop = osTop+isSpeed; 
                //判断，然后清除定时器
                if (osTop == 0) {
                    clearInterval(timer);
                } 
                isTop = true;//添加在obtn.onclick事件的timer中    
            },30);                          
        };
        //获取页面的可视窗口高度
        var client_height = document.documentElement.clientHeight / 2 || document.body.clientHeight / 2;

        //在滚动的时候增加判断,忘了的话很容易出错
        var osTop = document.documentElement.scrollTop || document.body.scrollTop;
        if (osTop >= client_height) {
            obtn.style.opacity = '1';
        }else{
            obtn.style.opacity = '0';
        }         
        if(!isTop){
            clearInterval(timer);
        }
        isTop = false;

    }
    window.onload = function () {
        //页面加载时设置scrolltop高度
        document.body.scrollTop = GetCookie("a");
    }
    
    /**
     * 设置cookie
     */
    function SetCookie(sName, sValue) {
        document.cookie = sName + "=" + escape(sValue) + "; ";
    }
    /**
     * 读取cookie
     */
    function GetCookie(sName) {
        var aCookie = document.cookie.split("; ");
        for (var i = 0; i < aCookie.length; i++) {
            var aCrumb = aCookie[i].split("=");
            if (sName == aCrumb[0])
            {
                return unescape(aCrumb[1]);
            }
        }
        return 0;
    }
</script><style>
    .to_top{
        width: 50px;
        height: 50px;
        position: fixed;
        bottom: 10%;
        right: 20px;
        font-size: 40px;
        line-height: 70px;
        border: none;
        background: rgba(0,0,0,0.2);
        cursor: pointer;
        opacity: 0;
        /*display: none;*/
        transition: all 1s;
        z-index: 99999;
    }
</style><script src="/static/js/share.js"></script><link rel="stylesheet" href="/static/css/share_style0_24.css"><link rel="stylesheet" href="/static/css/share_popup.css"><link rel="stylesheet" href="/static/css/select_share.css"></head>



<body style="margin-top: 0px;">
    <!-- 回到顶部html -->
    <div>
		<img src="/static/images/timg.jpg" alt="" class="to_top" data-bd-imgshare-binded="1" style="opacity: 0;">
	</div>




<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container cl">
            <a class="navbar-logo hidden-xs" href="https://guanchao.site/index/index/index.html">
                <img class="logo" src="/static/images/5c09c5ca26c64.png" alt="时间里的博客" data-bd-imgshare-binded="1">
            </a>
            <a class="logo navbar-logo-m visible-xs"><b>时间里的</b></a>
            <!-- <div class="visible-xs" style=" overflow: hidden; margin-left:5px;float: left; position: relative;">
                                    <form action="/index/user/index.html" method = 'post' style="position: relative;">
                        <input type="hidden" name="now_url" value="" id = 'now_url'>
                        <img class="visible-xs" onclick="login_qq()" style="width:30px;height: 30px; margin: 7px 0; " src="/style/home/img/QQ.png" title="登入">
                        <button style="position: absolute; width: 30px;height:30px;left: 50%;margin-left: -15px;top: 50%;margin-top: -15px;opacity: 0; cursor:pointer;"></button>
                    </form>
                            </div> -->
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:void(0);" onclick="showSide();"></a>
            <nav class="nav navbar-nav nav-collapse w_menu" role="navigation">
                <ul class="cl">
					<li> <a href="/blog/" data-hover="首页">首页</a> </li>
					<li><a href="/blog/python/" data-hover="Python">Python</a></li>
					<li><a href="/blog/golang/" data-hover="Golang">Golang</a></li>
					<li><a href="/blog/c++/" data-hover="C++">C++</a></li>
					<li><a href="/blog/database/" data-hover="数据库">数据库</a></li>
					<li><a href="/blog/rests/" data-hover="其他">其他</a></li>
                </ul>
            </nav>
            <nav class="navbar-nav navbar-userbar hidden-xs hidden-sm " style="top: 0;">
                <ul class="cl">
                    <li class="userInfo dropDown dropDown_hover">
{{/*                                                    <form action="https://guanchao.site/index/user/index.html" method="post" style="position: relative;">*/}}
                                <input type="hidden" name="now_url" value="" id="now_url">
{{/*                                <a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="login_qq()">*/}}
                                    <img class="avatar size-S" style="width:30px;height: 30px;" src="/static/images/QQ.png" title="登入" data-bd-imgshare-binded="1">
                                    <!-- <input type="submit" value="登入"> -->
                                    <button style="position: absolute; width: 30px;height:30px;left: 50%;margin-left: -15px;top: 50%;margin-top: -15px;opacity: 0; cursor:pointer;"></button>
                                </a>
{{/*                            </form>*/}}
                                                    <!-- <a href="/index/user/index.html" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" > -->
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<script>
    // 登录取当前页url（用于登录成功之后返回使用） 
    function login_qq(){
        var now_url = this.location.href;
        $("#now_url").val(now_url);
    }

    // ajax退出登录
    function layout(){
        $.ajax({
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/index/user/layout.html" ,//url
            data: {},
            success: function (data) {
                if (data.code == 1) {
                    layer.msg('操作成功',{time:500},function(){
                      document.location.reload();
                    });//*/
                }else{
                    layer.msg('操作失败');
                };
            },
            error : function() {
                alert("异常！");
            }
        });//*/
    }

    

</script>


<section class="container pt-20">
	<div id="loginSession" data-status=""></div>
	<div class="row w_main_row">
				<div class="col-lg-9 col-md-9 w_main_left">
					<div class="panel panel-default  mb-20">
						<div class="panel-body pt-10 pb-10">
							{{if .blog}}
							<h2 class="c_titile">{{.blog.Title}}</h2>
							<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>
							<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>
							{{safe  .blog.Content}}


								<span class="d_time">发布时间：{{timecut .blog.CreatedAt}}</span>
							<span>
									阅读：{{.blog.LookNum}} </span>
							{{end}}

							{{if .blog}}
								{{if .blog.ID}}
							<div class="nextinfo">
								{{if .pern.ID}}
																	<p class="last">上一篇：<a href="/blog/details/?artid={{.pern.ShowImage}}">{{.pern.Title}}</a></p>
								{{else}}
								<p class="last">上一篇：<a href="#">这是最新的了</a></p>
								{{end}}
								{{if .next.ID}}
								<p class="next">下一篇：<a href="/blog/details/?artid={{.next.ShowImage}}">{{.next.Title}}</a></p>
								{{else}}
									<p class="next">下一篇：<a href="#">没有下一篇了</a></p>
								{{end}}
							</div>
									{{end}}
							{{end}}
						</div>
					</div>

				</div>
				<div class="col-lg-3 col-md-3">


					<!--图片-->
		<div class="bg-fff box-shadow radius mb-20">
			<div class="tab-category">
				<iframe frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ width=auto height=auto src="https://music.163.com/outchain/player?type=0&amp;id=827912183&amp;_hash=songlist-450795499&amp;&auto=0&height=auto&width=auto"></iframe>
			</div>

		</div>
					
	</div>
</div>
	
</section>


<!-- 引用jquery、highlight.pack.js -->
<script type="text/javascript" src="/static/js/highlight.pack.js"></script>
<script type="text/javascript">
	SyntaxHighlighter.all();

	// 引用jquery、highlight.pack.js 之后，再执行如下代码
	$(function(){
		$('pre code').each(function(i, block) {
	    		hljs.highlightBlock(block);
	  	});
	});

	//用window的onload事件，窗体加载完毕的时候
    window.onload=function()
    {
    	if ({{ .blog.ID}}){

		}else{
    		alert("页面不存在，即将返回首页");
    		location.href = "/blog/"
	}

		// 获取登录状态
        var loginStatus = getLoginStatus();
		if(loginStatus != "")
        {
			var comment = document.getElementById("comment");
			// 获取email输入框数组
			var aBox=getByClass(comment, 'input_email');
			//console.log(aBox);
			for(var i=0;i<aBox.length;i++){
				aBox[i].style.display="none";
			}
		}
    }

	$("#fileDown").click(function(){
		// 获取登录状态
        var loginStatus = getLoginStatus();
		if(!loginStatus)
        {
			layer.msg("请先登录！");
			return false;
		}
	});

	/**
	 * 获取class
	 */
	function getByClass(oParent, sClass){
		var aResult=[];
		var aEle=oParent.getElementsByTagName('*');
		for(var i=0;i<aEle.length;i++){
			if(aEle[i].className==sClass)
			{
				aResult.push(aEle[i]);
			}
		}
		return aResult;
	}
	/**
	 * 获取登录状态
	 */
    function getLoginStatus()
    {
        var loginStatus = document.getElementById('loginStatus').getAttribute("data-status");
        return loginStatus;
    }

	/**
	 *
	 */
	 function getLoginSession()
	 {
        var loginSession = document.getElementById('loginSession').getAttribute("data-status");
        return loginSession;
	 }

	/**
	 * 提交回复
	 */
    function putReply(){
        var content = document.getElementById('content').value;
		// 获取登录状态
        var loginStatus = getLoginSession();
		if(loginStatus == "")
        {
			layer.msg('请先登录！');
            return false;
		}
        if(content == ''){
            layer.msg('回复内容不可为空！');
            return false;
        }
		var emailReply = document.getElementById("emailReply").value;
		var loginStatus = getLoginStatus();
        if(loginStatus == "")
        {
            var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
            if(!reg.test(emailReply)){
                layer.msg("邮箱格式不正确");
                return false;
            }
        }
        $.ajax({
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/index/article/putcomment.html" ,//url
            data: $('#putReply').serialize(),
            success: function (data) {
                if (data.code == 1) {
					document.getElementById('content').value = '';
                    layer.msg('操作成功',{time:500},function(){
                      document.location.reload();
                    });//*/
                    // layer.msg('操作成功');
                }else{
                    layer.msg(data.msg);
                };
            },
            error : function() {
                alert("异常！");
            }
        });//*/
    }

	/**
	 * 提交评论
	 */
    function putComment() {
    	var content_s = document.getElementById('textarea1').value;
		// 获取登录状态
        var loginStatus = getLoginSession();
        if(loginStatus == "")
        {
            layer.msg('请先登录！');
            return false;
        }
        if(content_s == ''){
            layer.msg('评论内容不可为空！');
            return false;
        }
		var emailComment = document.getElementById("emailComment").value;
		var loginStatus = getLoginStatus();
        if(loginStatus == "")
        {
            var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
            if(!reg.test(emailComment)){
                layer.msg("邮箱格式不正确");
                return false;
            }
        }
        $.ajax({
        //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/index/article/putcomment.html" ,//url
            data: $('#addform').serialize(),
            success: function (data) {
				console.log(data);
                if (data.code == 1) {
                    layer.msg('操作成功',{time:500},function(){
                      document.location.reload();
                    });//*/
                    //layer.msg('操作成功');
                }else{
                    layer.msg(data.msg);
                };
            },
            error : function() {
                alert("异常！");
            }
        });
    }

    $(function () {
    		$("img.lazyload").lazyload({failurelimit : 3});
    	var url = 'https://guanchao.site';
        wangEditor.config.printLog = false;
        var editor1 = new wangEditor('textarea1');
        editor1.config.menus = ['insertcode', 'quote', 'bold', '|', 'img', 'emotion', '|', 'undo', 'fullscreen'];
        editor1.config.emotions = { 'default': { title: '表情', data: url+'/style/home/plugin/wangEditor/emotions1.data'}, 'default2': { title: '心情', data: url+'/style/home/plugin/wangEditor/emotions3.data'}, 'default3': { title: '顶一顶', data: url+'/style/home/plugin/wangEditor/emotions2.data'}};
        editor1.create();

        //show reply
        $(".hf").click(function () {
            pId = $(this).attr("name");
            // 点击回复按钮时，将值赋到对应的隐藏域中
            var id = $(this).attr("data-id");
            $('input[name=replyid]').val(id);
            $(this).parents(".commentList").find(".cancelReply").trigger("click");
            $(this).parent(".comment-body").append($(".comment").clone(true));
            $(this).parent(".comment-body").find(".comment").removeClass("hidden");
            $(this).hide();
        });
        //cancel reply
        $(".cancelReply").on('click',function () {
            $(this).parents(".comment-body").find(".hf").show();
            $(this).parents(".comment-body").find(".comment").remove();
        });
    });

</script>

<footer class="footer mt-20">
	<div class="container-fluid" id="foot">
		<p>Copyright © 2016-2020
			<br>
			<br>
		</p>
	</div>
</footer>




<div id="bdimgshare_1587732548575" class="sr-bdimgshare sr-bdimgshare-list sr-bdimgshare-24 sr-bdimgshare-black" style="height:42px;line-height:32px;font-size:14px;width:auto;display:none;" data-bd-bind="1587732548575"><div class="bdimgshare-bg"></div><div class="bdimgshare-content bdsharebuttonbox bdshare-button-style0-24" data-bd-bind="1587732548577"><label class="bdimgshare-lbl">分享到：</label><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_qzone" data-cmd="qzone" hidefocus="" title="分享到QQ空间"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_tsina" data-cmd="tsina" hidefocus="" title="分享到新浪微博"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_tqq" data-cmd="tqq" hidefocus="" title="分享到腾讯微博"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_renren" data-cmd="renren" hidefocus="" title="分享到人人网"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_weixin" data-cmd="weixin" hidefocus="" title="分享到微信"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" onclick="return false;" class="bds_more" data-cmd="more" hidefocus=""></a></div></div><iframe frameborder="0" id="bdSharePopup_selectshare1587732548580bg" class="bdselect_share_bg" style="display:none;" src="./时间里的博客_技术博客_files/saved_resource.html"></iframe><div id="bdSharePopup_selectshare1587732548580box" style="display: none;" share-type="selectshare" class="bdselect_share_box" data-bd-bind="1587732548580"><div class="selectshare-mod-triangle"><div class="triangle-border"></div><div class="triangle-inset"></div></div><div class="bdselect_share_head"><span>分享到</span><a href="http://www.baidu.com/s?wd=&amp;tn=SE_hldp08010_vurs2xrp" class="bdselect_share_dialog_search" target="_blank"><i class="bdselect_share_dialog_search_i"></i><span class="bdselect_share_dialog_search_span">百度一下</span></a><a class="bdselect_share_dialog_close"></a></div><div class="bdselect_share_content"><ul class="bdselect_share_list bdshare-button-style0-24"><div class="bdselect_share_partners"><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_qzone" data-cmd="qzone"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_tsina" data-cmd="tsina"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_tqq" data-cmd="tqq"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_renren" data-cmd="renren"></a><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_weixin" data-cmd="weixin"></a></div><a href="https://guanchao.site/index/article/articledetail.html?artid=391#" class="bds_more" data-cmd="more"></a></ul></div></div></body></html>